<?php
require __DIR__ . '/header_loadfile.php';
?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <meta name="renderer" content="webkit" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <title><?=$GLOBALS['config']['title_full']?></title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
  <!-- Bootstrap 3.3.7 -->
  <link rel="stylesheet" href="<?php echo $GLOBALS['config']['AdminLTE'];?>/bower_components/bootstrap/dist/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="<?php echo $GLOBALS['config']['AdminLTE'];?>/bower_components/font-awesome/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="<?php echo $GLOBALS['config']['AdminLTE'];?>/bower_components/Ionicons/css/ionicons.min.css">

  <!-- DataTables -->
  <link rel="stylesheet" href="<?php echo $GLOBALS['config']['AdminLTE'];?>/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">

  <style>
    html, body {
        height: 100%;
    }
    .header {
        font-size: 14px;
    }
    .skin-blue .main-header .logo {
        background-color: #000000 !important;
    }
    .skin-blue .main-header .navbar {
        background-color: #222d32 !important;/* 深灰色 */
    }
    .skin-blue .main-header .navbar .sidebar-toggle:hover {
        background-color: #ff8000 !important;
    }
    .skin-blue .sidebar-menu>li.active>a {
        border-left-color: #ff8000 !important;
        background-color: #804000 !important;
    }
    .btn-primary {
        background-color: #ff8000 !important;
        border-color: #ff8000 !important;
    }
    .login-page, .register-page {
        background-image: linear-gradient(#777777, #222222) !important;
    }
    .login-box-body, .register-box-body {
        border-radius: 20px;
        box-shadow: 0 0 20px #888888;
    }
    .login-box, .register-box {
        width: 500px !important;
        background-color: #ffffff;
        padding: 58px 50px 63px 50px;
        border-radius: 20px;
    }
    .login-logo, .register-logo {
        margin-bottom: 45px !important;
    }
    .skin-blue .main-header li.user-header {
        background-color: #2c3b41 !important;/* 浅灰色 */
    }
    .dropdown-menu {
        box-shadow: -10px 10px 10px #888888 !important;
    }
  </style>

<script src="<?php echo $GLOBALS['config']['url_static'];?>/lib.js"></script>
<script src="<?php echo $GLOBALS['config']['url_static'];?>/vue/common.js"></script>

<style>
.wxtip{background: rgba(0,0,0,0.8); text-align: center; position: fixed; left:0; top: 0; width: 100%; height: 100%; z-index: 998; display: none;}
.wxtip-icon{width: 52px; height: 67px; background: url(<?php echo $GLOBALS['config']['url_static'];?>/images/weixin-tip.png) no-repeat; display: block; position: absolute; right: 20px; top: 20px;}
.wxtip-txt{margin-top: 107px; color: #fff; font-size: 16px; line-height: 1.5;}
</style>
<div class="wxtip" id="JweixinTip">
    <span class="wxtip-icon"></span>
    <p class="wxtip-txt">点击右上角<br/>选择在浏览器中打开</p>
</div>
<script>
window.config = <?=json_encode($GLOBALS['config'])?>;
const param = window.getParams();
if (param.wxcode) window.localStorage.wxcode = param.wxcode;

function is_weixin() {
    var ua = window.navigator.userAgent.toLowerCase();
    if (ua.match(/MicroMessenger/i) == 'micromessenger') {
        return true;
    } else {
        return false;
    }
}
if (window.config.usewx && is_weixin()) {
    // 如果在微信里打开的
    if (!param.wxcode && window.config.weixin_auth) {
        // 没登录的，就跳到微信验证
        location.href = window.config.weixin_auth;
    } else {
        // 已经登录的，但还在微信里，要求通过浏览器打开
        document.getElementById('JweixinTip').style.display='block';
    }
}
</script>